<template>
  <div class="quick">
    <Quick :data="left" v-if="left.length"></Quick>
    <p>{{flag}}</p>
    <Quick :data="right" v-if="right.length"></Quick>
  </div>
</template>

<script>
export default {
  name: "Quick",
  props: ["data"],
  setup(props) {
    // eslint-disable-next-line vue/no-setup-props-destructure
    let flag = props.data[0];
    let left = [];
    let right = [];
    props.data.slice(1).forEach(v => {
      v > flag ? right.push(v) : left.push(v);
    });
    return { left, right, flag };
  }
};
</script>

<style scoped>
</style>
